<?php require_once('Connections/sqlaerosnemanje.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>AeroPHPXML :: Pregled Projektov</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>

<body>
<p><span class="myhead">Pregled &amp; Brisanje </span></p>
<p><b>Pozor!</b><br />
Brisanje ima takoj&scaron;nje posledice, brez mo&#382;nosti povratka.<br />
<span class="small-font"><strong><br />
Legenda:</strong><br />
<img src="images/cancel.png" width="16" height="16" /> Brisanje<br />
<img src="images/magnifier.png" width="16" height="16" /> Pogled</span></p>
<?php
mysql_select_db("aerosnemanje", $sqlaerosnemanje);
$seznam_query="SELECT * FROM `projekti`";
$seznam_result=mysql_query($seznam_query);
$num=mysql_numrows($seznam_result);
?>
  <table width="550" border="0" cellpadding="2" cellspacing="1" bgcolor="#999999">
    <tr>
      <th>ID</th>
    <th>Naziv</th>
    <th>To&#269;ke<br>WGS84</th>
    <th>Rezultat<br />
      Letenja</th>
    <th>To&#269;ke<br />D96</th>
    <th>Rezultat<br />
      Letenja</th>
    <th width="90">Brisanje</th>
    </tr>
    
    <?php
$i=0;
while ($i < $num) {

$id=mysql_result($seznam_result,$i,"IDP");
$nazivp=mysql_result($seznam_result,$i,"Naziv");

$tocke_wg_query="SELECT COUNT(*) FROM `tocke_geodetic` WHERE `IDProjekta` = '$id'";
$tocke_wg = mysql_query($tocke_wg_query, $sqlaerosnemanje) or die(mysql_error());
$row_tocke_wg = mysql_fetch_array($tocke_wg);

$tocke_wgr_query="SELECT COUNT(*) FROM `tocke_geodetic_result` WHERE `IDProjekta` = '$id'";
$tocke_wgr = mysql_query($tocke_wgr_query, $sqlaerosnemanje) or die(mysql_error());
$row_tocke_wgr = mysql_fetch_array($tocke_wgr);

$tocke_gk_query="SELECT COUNT(*) FROM `tocke_grid` WHERE `IDProjekta` = '$id'";
$tocke_gk = mysql_query($tocke_gk_query, $sqlaerosnemanje) or die(mysql_error());
$row_tocke_gk = mysql_fetch_array($tocke_gk);

$tocke_gkr_query="SELECT COUNT(*) FROM `tocke_grid_result` WHERE `IDProjekta` = '$id'";
$tocke_gkr = mysql_query($tocke_gkr_query, $sqlaerosnemanje) or die(mysql_error());
$row_tocke_gkr = mysql_fetch_array($tocke_gkr);
?>
    
    <tr>
      <td align="center" valign="middle" bgcolor="#CCCCCC">
      <?php echo "<b>".$id."</b>"; ?></td>
    <td valign="middle" bgcolor="#CCCCCC">
      <?php echo $nazivp; ?></td>
    <td align="center" valign="middle" bgcolor="#CCCCCC">
      <?php
		if ($row_tocke_wg[0] > 0)
	{
		echo "<a href=\"brisi_tocke_wg.php?idprojekta=$id&gkpid=0\"><img src=\"images/cancel.png\" width=\"16\" height=\"16\" border=0 /></a> (".$row_tocke_wg[0].") <a href=\"seznam_tock.php?iprojekt=$id&tipkoo=1\"><img src=\"images/magnifier.png\" width=\"16\" height=\"16\" border=0 /></a>";
	}
	else
	{
		echo "Ni to&#269;k";
	}
		?></td>
    <td align="center" valign="middle" bgcolor="#CCCCCC">
      <?php
		if ($row_tocke_wgr[0] > 0)
	{
		echo "<a href=\"brisi_tocke_wgr.php?idprojekta=$id&gkpid=0\"><img src=\"images/cancel.png\" width=\"16\" height=\"16\" border=0 /></a> (".$row_tocke_wgr[0].") <a href=\"seznam_tock.php?iprojekt=$id&tipkoo=2\"><img src=\"images/magnifier.png\" width=\"16\" height=\"16\" border=0 /></a>";
	}
	else
	{
		echo "Ni to&#269;k";
	}
		?></td>
    <td align="center" valign="middle" bgcolor="#CCCCCC">
      <?php
		if ($row_tocke_gk[0] > 0)
	{
		echo "<a href=\"brisi_tocke_gk.php?idprojekta=$id&gkpid=0\"><img src=\"images/cancel.png\" width=\"16\" height=\"16\" border=0 /></a> (".$row_tocke_gk[0].") <a href=\"seznam_tock.php?iprojekt=$id&tipkoo=3\"><img src=\"images/magnifier.png\" width=\"16\" height=\"16\" border=0 /></a>";
	}
	else
	{
		echo "Ni to&#269;k";
	}
		?></td>
    <td align="center" valign="middle" bgcolor="#CCCCCC">
      <?php
		if ($row_tocke_gkr[0] > 0)
	{
		echo "<a href=\"brisi_tocke_gkr.php?idprojekta=$id&gkpid=0\"><img src=\"images/cancel.png\" width=\"16\" height=\"16\" border=0 /></a> (".$row_tocke_gkr[0].") <a href=\"seznam_tock.php?iprojekt=$id&tipkoo=4\"><img src=\"images/magnifier.png\" width=\"16\" height=\"16\" border=0 /></a>";
	}
	else
	{
		echo "Ni to&#269;k";
	}
		?></td>
    <td width="90" align="right" valign="middle" bgcolor="#CCCCCC">
      <?php
	echo "<a href=\"brisi_projekt.php?idprojekta=$id&gkpid=0\">Bri&scaron;i Projekt <img src=\"images/cancel.png\" width=\"16\" height=\"16\" border=0 /></a>";
	?></td>
    <?php
$i++;
}
mysql_close();
?>
    </tr>
  </table>
  <br>
  <a href="index.php">&lt;&lt;&lt; Nazaj na prvo stran</a><br>
</body>
</html>
